{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "人均消费 236.87989314892795\n",
      "人均刷卡频次 64.0\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Index_x</th>\n",
       "      <th>CardNo</th>\n",
       "      <th>PeoNo</th>\n",
       "      <th>Date</th>\n",
       "      <th>Money</th>\n",
       "      <th>FundMoney</th>\n",
       "      <th>Surplus</th>\n",
       "      <th>CardCount</th>\n",
       "      <th>Type</th>\n",
       "      <th>Dept</th>\n",
       "      <th>day</th>\n",
       "      <th>hour</th>\n",
       "      <th>Index_y</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Major</th>\n",
       "      <th>AccessCardNo</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>117342773</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/20 20:17</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>186.1</td>\n",
       "      <td>818</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>20</td>\n",
       "      <td>20</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>117292207</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/18 7:26</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>28.6</td>\n",
       "      <td>807</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>18</td>\n",
       "      <td>7</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>117297758</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/19 7:32</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>214.0</td>\n",
       "      <td>811</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>19</td>\n",
       "      <td>7</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>117259188</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/16 18:10</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>47.5</td>\n",
       "      <td>801</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>16</td>\n",
       "      <td>18</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>117022302</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/4 7:31</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>160.5</td>\n",
       "      <td>746</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>117022431</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/2 7:37</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>133.8</td>\n",
       "      <td>752</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>117026105</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/2 7:37</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>134.4</td>\n",
       "      <td>751</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>117073031</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/30 8:31</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>79.0</td>\n",
       "      <td>763</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>30</td>\n",
       "      <td>8</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>117076472</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/8 7:30</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>769</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>117076474</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/8 7:30</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>60.4</td>\n",
       "      <td>770</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>116968849</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/6 12:16</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>220.6</td>\n",
       "      <td>735</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>116970394</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/6 19:00</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>203.1</td>\n",
       "      <td>739</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>6</td>\n",
       "      <td>19</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>116971319</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/6 12:16</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>217.1</td>\n",
       "      <td>736</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>116977895</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/6 18:59</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>211.1</td>\n",
       "      <td>738</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>6</td>\n",
       "      <td>18</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>116983276</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/6 12:14</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>223.1</td>\n",
       "      <td>734</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>116984880</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/5 8:50</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>223.5</td>\n",
       "      <td>733</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>117341695</td>\n",
       "      <td>181316</td>\n",
       "      <td>20181316</td>\n",
       "      <td>2019/4/20 20:14</td>\n",
       "      <td>1.2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>189.1</td>\n",
       "      <td>817</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>20</td>\n",
       "      <td>20</td>\n",
       "      <td>1316</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21516778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>117341693</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/20 20:13</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>51.4</td>\n",
       "      <td>674</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>20</td>\n",
       "      <td>20</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>117342774</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/20 20:18</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>47.9</td>\n",
       "      <td>675</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>20</td>\n",
       "      <td>20</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>117297757</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/19 7:32</td>\n",
       "      <td>2.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>75.4</td>\n",
       "      <td>670</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>19</td>\n",
       "      <td>7</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>117258939</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/15 21:04</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>127.8</td>\n",
       "      <td>660</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>15</td>\n",
       "      <td>21</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>117022301</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/4 7:31</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>62.3</td>\n",
       "      <td>623</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>117026104</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/2 7:37</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>44.2</td>\n",
       "      <td>626</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>117436723</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/25 7:23</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>86.8</td>\n",
       "      <td>689</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>25</td>\n",
       "      <td>7</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>117073029</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/30 8:31</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>22.7</td>\n",
       "      <td>631</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>30</td>\n",
       "      <td>8</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>117075245</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/29 20:30</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>28.2</td>\n",
       "      <td>629</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>29</td>\n",
       "      <td>20</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>117076039</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/29 20:31</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>25.2</td>\n",
       "      <td>630</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>29</td>\n",
       "      <td>20</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>117076473</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/8 7:30</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>16.6</td>\n",
       "      <td>633</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>117077150</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/30 8:32</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>19.7</td>\n",
       "      <td>632</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>30</td>\n",
       "      <td>8</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>116968848</td>\n",
       "      <td>181318</td>\n",
       "      <td>20181318</td>\n",
       "      <td>2019/4/6 12:15</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>102.0</td>\n",
       "      <td>614</td>\n",
       "      <td>消费</td>\n",
       "      <td>第一食堂</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>1318</td>\n",
       "      <td>女</td>\n",
       "      <td>18工业设计</td>\n",
       "      <td>21256154</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204329</th>\n",
       "      <td>117008361</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/4 17:24</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>80.9</td>\n",
       "      <td>840</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>4</td>\n",
       "      <td>17</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204330</th>\n",
       "      <td>117009618</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/2 7:36</td>\n",
       "      <td>1.8</td>\n",
       "      <td>0.0</td>\n",
       "      <td>77.1</td>\n",
       "      <td>842</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204331</th>\n",
       "      <td>117012259</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/2 11:53</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>76.7</td>\n",
       "      <td>843</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>2</td>\n",
       "      <td>11</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204332</th>\n",
       "      <td>117013084</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/3 16:34</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>101.1</td>\n",
       "      <td>833</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>3</td>\n",
       "      <td>16</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204333</th>\n",
       "      <td>117013530</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/4 17:22</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>86.9</td>\n",
       "      <td>838</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>4</td>\n",
       "      <td>17</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204334</th>\n",
       "      <td>117014744</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/4 7:33</td>\n",
       "      <td>1.8</td>\n",
       "      <td>0.0</td>\n",
       "      <td>93.3</td>\n",
       "      <td>836</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204335</th>\n",
       "      <td>117014991</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/4 17:23</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>84.4</td>\n",
       "      <td>839</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>4</td>\n",
       "      <td>17</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204336</th>\n",
       "      <td>117015276</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/2 11:54</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>73.7</td>\n",
       "      <td>844</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>2</td>\n",
       "      <td>11</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204337</th>\n",
       "      <td>116952089</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/1 18:53</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>46.9</td>\n",
       "      <td>822</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>1</td>\n",
       "      <td>18</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204338</th>\n",
       "      <td>116952896</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/1 11:38</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>52.9</td>\n",
       "      <td>821</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204339</th>\n",
       "      <td>116953078</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/7 18:16</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.5</td>\n",
       "      <td>831</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>7</td>\n",
       "      <td>18</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204340</th>\n",
       "      <td>116955403</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/7 18:16</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>830</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>7</td>\n",
       "      <td>18</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204341</th>\n",
       "      <td>116959836</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/1 11:36</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>57.9</td>\n",
       "      <td>819</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204342</th>\n",
       "      <td>116960108</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/7 18:15</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.5</td>\n",
       "      <td>829</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>7</td>\n",
       "      <td>18</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204343</th>\n",
       "      <td>116961256</td>\n",
       "      <td>180483</td>\n",
       "      <td>2018483</td>\n",
       "      <td>2019/4/1 11:37</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>56.4</td>\n",
       "      <td>820</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>483</td>\n",
       "      <td>女</td>\n",
       "      <td>18投资与理财</td>\n",
       "      <td>21602922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204344</th>\n",
       "      <td>117079608</td>\n",
       "      <td>184185</td>\n",
       "      <td>20184185</td>\n",
       "      <td>2019/4/9 17:11</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>478</td>\n",
       "      <td>无卡销户</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>9</td>\n",
       "      <td>17</td>\n",
       "      <td>4185</td>\n",
       "      <td>女</td>\n",
       "      <td>18国际商务</td>\n",
       "      <td>17707013</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204345</th>\n",
       "      <td>116952827</td>\n",
       "      <td>180570</td>\n",
       "      <td>2018570</td>\n",
       "      <td>2019/4/1 7:35</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.2</td>\n",
       "      <td>604</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>570</td>\n",
       "      <td>女</td>\n",
       "      <td>18电子商务</td>\n",
       "      <td>21407978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204346</th>\n",
       "      <td>116955982</td>\n",
       "      <td>180570</td>\n",
       "      <td>2018570</td>\n",
       "      <td>2019/4/1 7:36</td>\n",
       "      <td>1.2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>605</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>570</td>\n",
       "      <td>女</td>\n",
       "      <td>18电子商务</td>\n",
       "      <td>21407978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204347</th>\n",
       "      <td>117157089</td>\n",
       "      <td>184261</td>\n",
       "      <td>20184261</td>\n",
       "      <td>2019/4/12 11:31</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>18.4</td>\n",
       "      <td>189</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>12</td>\n",
       "      <td>11</td>\n",
       "      <td>4261</td>\n",
       "      <td>男</td>\n",
       "      <td>18计算机网络</td>\n",
       "      <td>620214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204348</th>\n",
       "      <td>117157090</td>\n",
       "      <td>184261</td>\n",
       "      <td>20184261</td>\n",
       "      <td>2019/4/12 11:32</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12.4</td>\n",
       "      <td>190</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>12</td>\n",
       "      <td>11</td>\n",
       "      <td>4261</td>\n",
       "      <td>男</td>\n",
       "      <td>18计算机网络</td>\n",
       "      <td>620214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204349</th>\n",
       "      <td>117157678</td>\n",
       "      <td>184261</td>\n",
       "      <td>20184261</td>\n",
       "      <td>2019/4/12 11:34</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>191</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>12</td>\n",
       "      <td>11</td>\n",
       "      <td>4261</td>\n",
       "      <td>男</td>\n",
       "      <td>18计算机网络</td>\n",
       "      <td>620214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204350</th>\n",
       "      <td>117096930</td>\n",
       "      <td>182648</td>\n",
       "      <td>20182648</td>\n",
       "      <td>2019/4/9 18:51</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>40.1</td>\n",
       "      <td>250</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>9</td>\n",
       "      <td>18</td>\n",
       "      <td>2648</td>\n",
       "      <td>女</td>\n",
       "      <td>18商务英语</td>\n",
       "      <td>20203610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204351</th>\n",
       "      <td>117096931</td>\n",
       "      <td>182648</td>\n",
       "      <td>20182648</td>\n",
       "      <td>2019/4/9 18:52</td>\n",
       "      <td>3.7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>36.4</td>\n",
       "      <td>251</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>9</td>\n",
       "      <td>18</td>\n",
       "      <td>2648</td>\n",
       "      <td>女</td>\n",
       "      <td>18商务英语</td>\n",
       "      <td>20203610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204352</th>\n",
       "      <td>117123394</td>\n",
       "      <td>182648</td>\n",
       "      <td>20182648</td>\n",
       "      <td>2019/4/10 12:13</td>\n",
       "      <td>6.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>26.9</td>\n",
       "      <td>253</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>10</td>\n",
       "      <td>12</td>\n",
       "      <td>2648</td>\n",
       "      <td>女</td>\n",
       "      <td>18商务英语</td>\n",
       "      <td>20203610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204353</th>\n",
       "      <td>117147838</td>\n",
       "      <td>182648</td>\n",
       "      <td>20182648</td>\n",
       "      <td>2019/4/11 11:58</td>\n",
       "      <td>8.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.2</td>\n",
       "      <td>258</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>11</td>\n",
       "      <td>11</td>\n",
       "      <td>2648</td>\n",
       "      <td>女</td>\n",
       "      <td>18商务英语</td>\n",
       "      <td>20203610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204354</th>\n",
       "      <td>117150868</td>\n",
       "      <td>182648</td>\n",
       "      <td>20182648</td>\n",
       "      <td>2019/4/10 18:45</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20.2</td>\n",
       "      <td>255</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>10</td>\n",
       "      <td>18</td>\n",
       "      <td>2648</td>\n",
       "      <td>女</td>\n",
       "      <td>18商务英语</td>\n",
       "      <td>20203610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204355</th>\n",
       "      <td>117161006</td>\n",
       "      <td>182648</td>\n",
       "      <td>20182648</td>\n",
       "      <td>2019/4/10 16:29</td>\n",
       "      <td>3.2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>23.7</td>\n",
       "      <td>254</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>10</td>\n",
       "      <td>16</td>\n",
       "      <td>2648</td>\n",
       "      <td>女</td>\n",
       "      <td>18商务英语</td>\n",
       "      <td>20203610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204356</th>\n",
       "      <td>117161098</td>\n",
       "      <td>182648</td>\n",
       "      <td>20182648</td>\n",
       "      <td>2019/4/10 21:18</td>\n",
       "      <td>2.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>17.7</td>\n",
       "      <td>256</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>10</td>\n",
       "      <td>21</td>\n",
       "      <td>2648</td>\n",
       "      <td>女</td>\n",
       "      <td>18商务英语</td>\n",
       "      <td>20203610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204357</th>\n",
       "      <td>117035608</td>\n",
       "      <td>181687</td>\n",
       "      <td>20181687</td>\n",
       "      <td>2019/4/8 12:24</td>\n",
       "      <td>9.7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>245</td>\n",
       "      <td>无卡销户</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>8</td>\n",
       "      <td>12</td>\n",
       "      <td>1687</td>\n",
       "      <td>男</td>\n",
       "      <td>18工程造价</td>\n",
       "      <td>19918026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204358</th>\n",
       "      <td>116957449</td>\n",
       "      <td>182852</td>\n",
       "      <td>20182852</td>\n",
       "      <td>2019/4/1 17:49</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.2</td>\n",
       "      <td>377</td>\n",
       "      <td>消费</td>\n",
       "      <td>第五食堂</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>2852</td>\n",
       "      <td>男</td>\n",
       "      <td>18计算机应用</td>\n",
       "      <td>25248602</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>204359 rows × 16 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          Index_x  CardNo     PeoNo             Date  Money  FundMoney  \\\n",
       "0       117342773  181316  20181316  2019/4/20 20:17    3.0        0.0   \n",
       "1       117292207  181316  20181316   2019/4/18 7:26    3.1        0.0   \n",
       "2       117297758  181316  20181316   2019/4/19 7:32    3.1        0.0   \n",
       "3       117259188  181316  20181316  2019/4/16 18:10    3.0        0.0   \n",
       "4       117022302  181316  20181316    2019/4/4 7:31    3.1        0.0   \n",
       "5       117022431  181316  20181316    2019/4/2 7:37    0.6        0.0   \n",
       "6       117026105  181316  20181316    2019/4/2 7:37    2.5        0.0   \n",
       "7       117073031  181316  20181316   2019/4/30 8:31    2.5        0.0   \n",
       "8       117076472  181316  20181316    2019/4/8 7:30    2.5        0.0   \n",
       "9       117076474  181316  20181316    2019/4/8 7:30    0.6        0.0   \n",
       "10      116968849  181316  20181316   2019/4/6 12:16    2.5        0.0   \n",
       "11      116970394  181316  20181316   2019/4/6 19:00    8.0        0.0   \n",
       "12      116971319  181316  20181316   2019/4/6 12:16    3.5        0.0   \n",
       "13      116977895  181316  20181316   2019/4/6 18:59    3.0        0.0   \n",
       "14      116983276  181316  20181316   2019/4/6 12:14    0.4        0.0   \n",
       "15      116984880  181316  20181316    2019/4/5 8:50    4.0        0.0   \n",
       "16      117341695  181316  20181316  2019/4/20 20:14    1.2        0.0   \n",
       "17      117341693  181318  20181318  2019/4/20 20:13    2.0        0.0   \n",
       "18      117342774  181318  20181318  2019/4/20 20:18    3.5        0.0   \n",
       "19      117297757  181318  20181318   2019/4/19 7:32    2.1        0.0   \n",
       "20      117258939  181318  20181318  2019/4/15 21:04    3.0        0.0   \n",
       "21      117022301  181318  20181318    2019/4/4 7:31    3.1        0.0   \n",
       "22      117026104  181318  20181318    2019/4/2 7:37    3.1        0.0   \n",
       "23      117436723  181318  20181318   2019/4/25 7:23    2.5        0.0   \n",
       "24      117073029  181318  20181318   2019/4/30 8:31    2.5        0.0   \n",
       "25      117075245  181318  20181318  2019/4/29 20:30    2.0        0.0   \n",
       "26      117076039  181318  20181318  2019/4/29 20:31    3.0        0.0   \n",
       "27      117076473  181318  20181318    2019/4/8 7:30    3.1        0.0   \n",
       "28      117077150  181318  20181318   2019/4/30 8:32    3.0        0.0   \n",
       "29      116968848  181318  20181318   2019/4/6 12:15    0.5        0.0   \n",
       "...           ...     ...       ...              ...    ...        ...   \n",
       "204329  117008361  180483   2018483   2019/4/4 17:24    3.5        0.0   \n",
       "204330  117009618  180483   2018483    2019/4/2 7:36    1.8        0.0   \n",
       "204331  117012259  180483   2018483   2019/4/2 11:53    0.4        0.0   \n",
       "204332  117013084  180483   2018483   2019/4/3 16:34    0.4        0.0   \n",
       "204333  117013530  180483   2018483   2019/4/4 17:22    0.4        0.0   \n",
       "204334  117014744  180483   2018483    2019/4/4 7:33    1.8        0.0   \n",
       "204335  117014991  180483   2018483   2019/4/4 17:23    2.5        0.0   \n",
       "204336  117015276  180483   2018483   2019/4/2 11:54    3.0        0.0   \n",
       "204337  116952089  180483   2018483   2019/4/1 18:53    6.0        0.0   \n",
       "204338  116952896  180483   2018483   2019/4/1 11:38    3.5        0.0   \n",
       "204339  116953078  180483   2018483   2019/4/7 18:16    1.5        0.0   \n",
       "204340  116955403  180483   2018483   2019/4/7 18:16    3.5        0.0   \n",
       "204341  116959836  180483   2018483   2019/4/1 11:36    0.4        0.0   \n",
       "204342  116960108  180483   2018483   2019/4/7 18:15    0.4        0.0   \n",
       "204343  116961256  180483   2018483   2019/4/1 11:37    1.5        0.0   \n",
       "204344  117079608  184185  20184185   2019/4/9 17:11    0.7        0.0   \n",
       "204345  116952827  180570   2018570    2019/4/1 7:35    2.0        0.0   \n",
       "204346  116955982  180570   2018570    2019/4/1 7:36    1.2        0.0   \n",
       "204347  117157089  184261  20184261  2019/4/12 11:31    8.0        0.0   \n",
       "204348  117157090  184261  20184261  2019/4/12 11:32    6.0        0.0   \n",
       "204349  117157678  184261  20184261  2019/4/12 11:34    6.0        0.0   \n",
       "204350  117096930  182648  20182648   2019/4/9 18:51    3.0        0.0   \n",
       "204351  117096931  182648  20182648   2019/4/9 18:52    3.7        0.0   \n",
       "204352  117123394  182648  20182648  2019/4/10 12:13    6.5        0.0   \n",
       "204353  117147838  182648  20182648  2019/4/11 11:58    8.1        0.0   \n",
       "204354  117150868  182648  20182648  2019/4/10 18:45    3.5        0.0   \n",
       "204355  117161006  182648  20182648  2019/4/10 16:29    3.2        0.0   \n",
       "204356  117161098  182648  20182648  2019/4/10 21:18    2.5        0.0   \n",
       "204357  117035608  181687  20181687   2019/4/8 12:24    9.7        0.0   \n",
       "204358  116957449  182852  20182852   2019/4/1 17:49    3.0        0.0   \n",
       "\n",
       "        Surplus  CardCount  Type  Dept  day  hour  Index_y Sex    Major  \\\n",
       "0         186.1        818    消费  第一食堂   20    20     1316   女   18工业设计   \n",
       "1          28.6        807    消费  第一食堂   18     7     1316   女   18工业设计   \n",
       "2         214.0        811    消费  第一食堂   19     7     1316   女   18工业设计   \n",
       "3          47.5        801    消费  第一食堂   16    18     1316   女   18工业设计   \n",
       "4         160.5        746    消费  第一食堂    4     7     1316   女   18工业设计   \n",
       "5         133.8        752    消费  第一食堂    2     7     1316   女   18工业设计   \n",
       "6         134.4        751    消费  第一食堂    2     7     1316   女   18工业设计   \n",
       "7          79.0        763    消费  第一食堂   30     8     1316   女   18工业设计   \n",
       "8          61.0        769    消费  第一食堂    8     7     1316   女   18工业设计   \n",
       "9          60.4        770    消费  第一食堂    8     7     1316   女   18工业设计   \n",
       "10        220.6        735    消费  第一食堂    6    12     1316   女   18工业设计   \n",
       "11        203.1        739    消费  第一食堂    6    19     1316   女   18工业设计   \n",
       "12        217.1        736    消费  第一食堂    6    12     1316   女   18工业设计   \n",
       "13        211.1        738    消费  第一食堂    6    18     1316   女   18工业设计   \n",
       "14        223.1        734    消费  第一食堂    6    12     1316   女   18工业设计   \n",
       "15        223.5        733    消费  第一食堂    5     8     1316   女   18工业设计   \n",
       "16        189.1        817    消费  第一食堂   20    20     1316   女   18工业设计   \n",
       "17         51.4        674    消费  第一食堂   20    20     1318   女   18工业设计   \n",
       "18         47.9        675    消费  第一食堂   20    20     1318   女   18工业设计   \n",
       "19         75.4        670    消费  第一食堂   19     7     1318   女   18工业设计   \n",
       "20        127.8        660    消费  第一食堂   15    21     1318   女   18工业设计   \n",
       "21         62.3        623    消费  第一食堂    4     7     1318   女   18工业设计   \n",
       "22         44.2        626    消费  第一食堂    2     7     1318   女   18工业设计   \n",
       "23         86.8        689    消费  第一食堂   25     7     1318   女   18工业设计   \n",
       "24         22.7        631    消费  第一食堂   30     8     1318   女   18工业设计   \n",
       "25         28.2        629    消费  第一食堂   29    20     1318   女   18工业设计   \n",
       "26         25.2        630    消费  第一食堂   29    20     1318   女   18工业设计   \n",
       "27         16.6        633    消费  第一食堂    8     7     1318   女   18工业设计   \n",
       "28         19.7        632    消费  第一食堂   30     8     1318   女   18工业设计   \n",
       "29        102.0        614    消费  第一食堂    6    12     1318   女   18工业设计   \n",
       "...         ...        ...   ...   ...  ...   ...      ...  ..      ...   \n",
       "204329     80.9        840    消费  第五食堂    4    17      483   女  18投资与理财   \n",
       "204330     77.1        842    消费  第五食堂    2     7      483   女  18投资与理财   \n",
       "204331     76.7        843    消费  第五食堂    2    11      483   女  18投资与理财   \n",
       "204332    101.1        833    消费  第五食堂    3    16      483   女  18投资与理财   \n",
       "204333     86.9        838    消费  第五食堂    4    17      483   女  18投资与理财   \n",
       "204334     93.3        836    消费  第五食堂    4     7      483   女  18投资与理财   \n",
       "204335     84.4        839    消费  第五食堂    4    17      483   女  18投资与理财   \n",
       "204336     73.7        844    消费  第五食堂    2    11      483   女  18投资与理财   \n",
       "204337     46.9        822    消费  第五食堂    1    18      483   女  18投资与理财   \n",
       "204338     52.9        821    消费  第五食堂    1    11      483   女  18投资与理财   \n",
       "204339      1.5        831    消费  第五食堂    7    18      483   女  18投资与理财   \n",
       "204340      3.0        830    消费  第五食堂    7    18      483   女  18投资与理财   \n",
       "204341     57.9        819    消费  第五食堂    1    11      483   女  18投资与理财   \n",
       "204342      6.5        829    消费  第五食堂    7    18      483   女  18投资与理财   \n",
       "204343     56.4        820    消费  第五食堂    1    11      483   女  18投资与理财   \n",
       "204344      0.0        478  无卡销户  第五食堂    9    17     4185   女   18国际商务   \n",
       "204345      9.2        604    消费  第五食堂    1     7      570   女   18电子商务   \n",
       "204346      8.0        605    消费  第五食堂    1     7      570   女   18电子商务   \n",
       "204347     18.4        189    消费  第五食堂   12    11     4261   男  18计算机网络   \n",
       "204348     12.4        190    消费  第五食堂   12    11     4261   男  18计算机网络   \n",
       "204349      6.4        191    消费  第五食堂   12    11     4261   男  18计算机网络   \n",
       "204350     40.1        250    消费  第五食堂    9    18     2648   女   18商务英语   \n",
       "204351     36.4        251    消费  第五食堂    9    18     2648   女   18商务英语   \n",
       "204352     26.9        253    消费  第五食堂   10    12     2648   女   18商务英语   \n",
       "204353      6.2        258    消费  第五食堂   11    11     2648   女   18商务英语   \n",
       "204354     20.2        255    消费  第五食堂   10    18     2648   女   18商务英语   \n",
       "204355     23.7        254    消费  第五食堂   10    16     2648   女   18商务英语   \n",
       "204356     17.7        256    消费  第五食堂   10    21     2648   女   18商务英语   \n",
       "204357      0.0        245  无卡销户  第五食堂    8    12     1687   男   18工程造价   \n",
       "204358      2.2        377    消费  第五食堂    1    17     2852   男  18计算机应用   \n",
       "\n",
       "        AccessCardNo  \n",
       "0           21516778  \n",
       "1           21516778  \n",
       "2           21516778  \n",
       "3           21516778  \n",
       "4           21516778  \n",
       "5           21516778  \n",
       "6           21516778  \n",
       "7           21516778  \n",
       "8           21516778  \n",
       "9           21516778  \n",
       "10          21516778  \n",
       "11          21516778  \n",
       "12          21516778  \n",
       "13          21516778  \n",
       "14          21516778  \n",
       "15          21516778  \n",
       "16          21516778  \n",
       "17          21256154  \n",
       "18          21256154  \n",
       "19          21256154  \n",
       "20          21256154  \n",
       "21          21256154  \n",
       "22          21256154  \n",
       "23          21256154  \n",
       "24          21256154  \n",
       "25          21256154  \n",
       "26          21256154  \n",
       "27          21256154  \n",
       "28          21256154  \n",
       "29          21256154  \n",
       "...              ...  \n",
       "204329      21602922  \n",
       "204330      21602922  \n",
       "204331      21602922  \n",
       "204332      21602922  \n",
       "204333      21602922  \n",
       "204334      21602922  \n",
       "204335      21602922  \n",
       "204336      21602922  \n",
       "204337      21602922  \n",
       "204338      21602922  \n",
       "204339      21602922  \n",
       "204340      21602922  \n",
       "204341      21602922  \n",
       "204342      21602922  \n",
       "204343      21602922  \n",
       "204344      17707013  \n",
       "204345      21407978  \n",
       "204346      21407978  \n",
       "204347        620214  \n",
       "204348        620214  \n",
       "204349        620214  \n",
       "204350      20203610  \n",
       "204351      20203610  \n",
       "204352      20203610  \n",
       "204353      20203610  \n",
       "204354      20203610  \n",
       "204355      20203610  \n",
       "204356      20203610  \n",
       "204357      19918026  \n",
       "204358      25248602  \n",
       "\n",
       "[204359 rows x 16 columns]"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd \n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib\n",
    "data1=pd.read_csv('C:/Users/Q/Desktop/code/task2_1.csv')\n",
    "# print(data1['CardNo'].count())\n",
    "dupe=data1.duplicated('CardNo')\n",
    "totalpeople=data1['CardNo'].count()-sum(dupe)#人数等于总刷卡数减去重复的刷卡id数\n",
    "totalpeople\n",
    "meanspend=sum(data1['Money'])/totalpeople #人均消费=总消费/总人数\n",
    "print('人均消费',meanspend)\n",
    "fenbu=data1['CardNo'].value_counts().values\n",
    "fenbu=sum(fenbu)/totalpeople#人均刷卡频次\n",
    "print('人均刷卡频次',round(fenbu))\n",
    "data1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "18连锁经营男生人均消费 306.79999999999933\n",
      "18连锁经营女生人均消费 246.551140350878\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEICAYAAABLdt/UAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGYlJREFUeJzt3X28VWWd9/HPVw4oginmiVIzskzHUtI5Q2Box0Lzqe5MZ3Je2tzmGNbtaPbkZFD5lDmWmllqjGhmjkYapk0laj6AD+nB1JzurEwsMafTYBClKPCbP65rw2Kzzzmbw4YNF9/363Ve7H2tta917b3P/q5r/dbaB0UEZmZWjs3aPQAzM2stB7uZWWEc7GZmhXGwm5kVxsFuZlYYB7ttcCSNlNTR7nGsCUnbSNq83eOoJ0ntHoOtfw72Akga0qBtH0nj+nnMWZKOybclaYikgyRdnm/vWLf+yyX97RqOa3NJvZX750g6tYmHfh748Jpsq4lx9Pu7np/zaq/jGpgOdNf1+X5Jl61pR5KGSfrvyv23SHp1vr2bpJfn27dJOjrfHidpmwbdXSjpA5K2k3Tvmo4l9/2UpF0GWOeXknYbTP/WehvVrGhTkz+0kyLiA/n+8cBngC2AiyLinLzqVyQ9DFwODImIpcCngcsqfXUAyyIiJA0FjgX2z4s/RdrJ3wMsJQXUl4E9KsM5CdgWmCvpc8BhwJK8bARwVEQ8Lml74IfAn3NfoyTdmdcbAyyVdEh+DpdGxFV5fIqVX6r4O+Dfm3yNfg1MBR4HZkVEZ4PVfgyMlrS00vYG4AlgWb4/FPgocJOkWcBelefXyGhgWGXMS4AX85hqO6X/qbXVjXkycA7wx9y0E9AVET8HiIgXJb1Ueci7gH+SNBH4BOm9Og54CXgpv7fXAF8ArpC0N+n1WwLsCBwMTAZ2lzQ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IsKxtozNLlgPbADMkPQFsDpweLhGsF56xb3xeK+nTwBjgWKATGFpbGBF3+cNjG4BlEfHFiNgf+B5wFPBUm8e0yXCwb3yWkP7Y2hLSH1f6APBmSfdIOqKtI7NNmqRuSbdLOhrYorLoDcAU4ML2jGzT42Df+DwTEVcBvwe+D5wHPAgcBhwvaf92Ds42aXcBp5BO5O8m6fuSDgLeBZwPPCLpre0c4KbCwb7x2VbSfsAoKn8aOSKeI/1Z5JPbNTDbtEXys4j4AvAI8CHSCdObI2IZMBP4P+0c46bCwb7xeRA4HJgN7E4qy3RI2iwifgdsJ2lofx2YrQcdEfF0REyNiPNz20OAz/+sB76OvQCSXpb/CBuSdoyIp9s9Jtu0SdorIn7a7nFsqhzsZmaFcSnGzKwwDnYzs8I42M3MCuNgNzMrjIPdzKww/wuDBcx8h2RflgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#18连锁经营专业不同性别消费对比图\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "major=data1[data1['Major']=='18连锁经营']\n",
    "majorman=major[major['Sex']=='男']\n",
    "majorwoman=major[major['Sex']=='女']\n",
    "\n",
    "\n",
    "dupe=majorman.duplicated('CardNo')\n",
    "totalpeople=majorman['CardNo'].count()-sum(dupe)\n",
    "totalpeople\n",
    "meanspend=sum(majorman['Money'])/totalpeople #人均消费\n",
    "print('18连锁经营男生人均消费',meanspend)\n",
    "\n",
    "dupe=majorwoman.duplicated('CardNo')\n",
    "totalpeople=majorwoman['CardNo'].count()-sum(dupe)\n",
    "totalpeople\n",
    "meanspend1=sum(majorwoman['Money'])/totalpeople #人均消费\n",
    "print('18连锁经营女生人均消费',meanspend1)\n",
    "\n",
    "l1=['男','女']\n",
    "l2=[meanspend,meanspend1]\n",
    "s1=pd.Series(l2,index=l1)\n",
    "matplotlib.rcParams['font.sans-serif']=['SimHei']\n",
    "s1.plot.bar(x=l1,y=l2)\n",
    "plt.title('18连锁经营专业不同性别消费对比图')\n",
    "plt.savefig('18连锁经营专业不同性别消费对比图.jpg')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "183835    297\n",
       "181416    242\n",
       "181899    225\n",
       "182720    201\n",
       "183276    198\n",
       "183448    193\n",
       "183233    191\n",
       "181243    183\n",
       "181327    180\n",
       "182695    177\n",
       "180921    177\n",
       "180714    177\n",
       "181582    176\n",
       "183220    175\n",
       "183582    175\n",
       "182604    173\n",
       "180942    173\n",
       "181629    173\n",
       "182839    172\n",
       "180669    172\n",
       "180622    172\n",
       "184043    171\n",
       "180593    170\n",
       "181462    169\n",
       "180797    169\n",
       "183447    167\n",
       "180816    167\n",
       "184179    167\n",
       "180650    167\n",
       "180920    164\n",
       "         ... \n",
       "182721      2\n",
       "180977      2\n",
       "183715      1\n",
       "184185      1\n",
       "181687      1\n",
       "180157      1\n",
       "183570      1\n",
       "182087      1\n",
       "180509      1\n",
       "181904      1\n",
       "184147      1\n",
       "182488      1\n",
       "181609      1\n",
       "182302      1\n",
       "183615      1\n",
       "181173      1\n",
       "180971      1\n",
       "181673      1\n",
       "182007      1\n",
       "182852      1\n",
       "180954      1\n",
       "182875      1\n",
       "184193      1\n",
       "183993      1\n",
       "183660      1\n",
       "181010      1\n",
       "181711      1\n",
       "184046      1\n",
       "183955      1\n",
       "183909      1\n",
       "Name: CardNo, Length: 3182, dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1['CardNo'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Int64Index([183835, 181416, 181899, 182720, 183276, 183448, 183233, 181243,\n",
       "            181327, 182695,\n",
       "            ...\n",
       "            180954, 182875, 184193, 183993, 183660, 181010, 181711, 184046,\n",
       "            183955, 183909],\n",
       "           dtype='int64', length=3182)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1['CardNo'].value_counts().index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 用money/刷卡次数/平均单次消费为聚类字段\n",
    "# data1['day']=pd.DatetimeIndex(data1['Date']).day\n",
    "q1=[]\n",
    "q2=[]\n",
    "q3=[]\n",
    "for i in data1['CardNo'].value_counts().index:\n",
    "    major=data1[data1['CardNo']==i]\n",
    "    q1.append(i)#卡号\n",
    "    q2.append(sum(major['Money']))#卡号对应的money\n",
    "    q3.append(len(major['Money'])-sum(major.duplicated(['day','hour'])))#刷卡频次统计：刷卡时间相近的算一次消费\n",
    "# print(q1)\n",
    "# print(q2)\n",
    "s1=pd.Series(q1,index=range(1,len(q1)+1),name='学号')\n",
    "s2=pd.Series(q2,index=range(1,len(q2)+1),name='金额')\n",
    "s3=pd.Series(q3,index=range(1,len(q3)+1),name='刷卡次数')\n",
    "df=pd.DataFrame({s1.name:s1,s2.name:s2,s3.name:s3})\n",
    "df.describe()\n",
    "#对要聚类的字段进行数据处理：消除一些刷卡次数少的人以及一些异常值\n",
    "a = df[\"刷卡次数\"].quantile(0.75)\n",
    "b = df[\"刷卡次数\"].quantile(0.25)\n",
    "c = df[\"金额\"].quantile(0.75)\n",
    "d = df[\"金额\"].quantile(0.25)\n",
    "demoney =df[\"刷卡次数\"]\n",
    "jine=df[\"金额\"]\n",
    "de=df[(jine>=(c-d)*1.5+c)|(demoney<=b)].index\n",
    "df=df.drop(de)\n",
    "df[\"平均单次消费\"]=df[\"金额\"]/df[\"刷卡次数\"]\n",
    "def ZscoreNormalization(x):#标准化\n",
    "    \"\"\"Z-score normaliaztion\"\"\"\n",
    "    x = (x - np.min(x)) / (np.max(x)-np.min(x))\n",
    "    return x\n",
    "df['金额']=ZscoreNormalization(df['金额'])\n",
    "df['刷卡次数']=ZscoreNormalization(df['刷卡次数'])\n",
    "df['平均单次消费']=ZscoreNormalization(df['平均单次消费'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "         金额      刷卡次数    平均单次消费  类别数目\n",
      "0  0.681068  0.562238  0.400722   506\n",
      "1  0.223105  0.115365  0.320176   658\n",
      "2  0.393390  0.420098  0.265424   614\n",
      "3  0.461125  0.208609  0.507581   560\n",
      "            金额      刷卡次数    平均单次消费  聚类类别\n",
      "4     0.485096  0.776119  0.175287     0\n",
      "6     0.798081  0.492537  0.526450     0\n",
      "7     0.727440  0.835821  0.287163     0\n",
      "8     0.718457  0.940299  0.245323     0\n",
      "9     0.722131  0.776119  0.308613     0\n",
      "11    0.765619  0.850746  0.301591     0\n",
      "12    0.535933  0.835821  0.184764     0\n",
      "13    0.870151  0.776119  0.391870     0\n",
      "14    0.733973  0.776119  0.315274     0\n",
      "15    0.535708  0.716418  0.224960     0\n",
      "16    0.666762  0.746269  0.289755     0\n",
      "17    0.701919  0.283582  0.657605     3\n",
      "18    0.987750  1.000000  0.353465     0\n",
      "19    0.766231  0.746269  0.347196     0\n",
      "20    0.525521  0.761194  0.203041     0\n",
      "21    0.630421  0.552239  0.363544     0\n",
      "22    0.813189  0.656716  0.422795     0\n",
      "23    0.698857  0.701493  0.328769     0\n",
      "24    0.568191  0.626866  0.282513     0\n",
      "25    0.573499  0.567164  0.315733     0\n",
      "26    0.678849  0.582090  0.379229     0\n",
      "27    0.614741  0.820896  0.232029     0\n",
      "28    0.705186  0.731343  0.318635     0\n",
      "29    0.630666  0.835821  0.235418     0\n",
      "31    0.440792  0.835821  0.133893     2\n",
      "32    0.617191  0.552239  0.354302     0\n",
      "33    0.797060  0.776119  0.350759     0\n",
      "34    0.574316  0.671642  0.266342     0\n",
      "35    0.681503  0.671642  0.332660     0\n",
      "36    0.814189  0.820896  0.340007     0\n",
      "...        ...       ...       ...   ...\n",
      "2549  0.292977  0.044776  0.505531     1\n",
      "2551  0.204165  0.074627  0.331397     1\n",
      "2559  0.253573  0.059701  0.422932     1\n",
      "2560  0.242752  0.000000  0.501173     1\n",
      "2562  0.291343  0.000000  0.585353     3\n",
      "2567  0.293589  0.000000  0.589244     3\n",
      "2570  0.215598  0.014925  0.429617     1\n",
      "2571  0.336872  0.074627  0.522984     3\n",
      "2577  0.170274  0.029851  0.334213     1\n",
      "2583  0.241527  0.014925  0.472809     1\n",
      "2593  0.292773  0.029851  0.530713     1\n",
      "2597  0.215598  0.000000  0.454131     1\n",
      "2598  0.141690  0.044776  0.271521     1\n",
      "2599  0.358105  0.059701  0.579048     3\n",
      "2606  0.175582  0.014925  0.362958     1\n",
      "2610  0.246223  0.029851  0.456043     1\n",
      "2613  0.146590  0.000000  0.334580     1\n",
      "2614  0.188853  0.029851  0.364016     1\n",
      "2617  0.084728  0.000000  0.227409     1\n",
      "2621  0.207023  0.029851  0.393163     1\n",
      "2624  0.248673  0.029851  0.459973     1\n",
      "2638  0.166803  0.000000  0.369597     1\n",
      "2639  0.300735  0.000000  0.601624     3\n",
      "2656  0.233769  0.000000  0.485610     1\n",
      "2661  0.128420  0.014925  0.284396     1\n",
      "2663  0.235198  0.000000  0.488086     1\n",
      "2669  0.123724  0.044776  0.243730     1\n",
      "2672  0.180482  0.014925  0.371120     1\n",
      "2677  0.175378  0.000000  0.384452     1\n",
      "2691  0.232544  0.014925  0.457845     1\n",
      "\n",
      "[2338 rows x 4 columns]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.cluster import KMeans\n",
    "from sklearn.cluster import Birch\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "d=df[['金额','刷卡次数','平均单次消费']]\n",
    "mod = KMeans(n_clusters=4, max_iter = 1000)#聚成3类数据,并发数为4，最大循环次数为500\n",
    "mod.fit_predict(d)#y_pred表示聚类的结果\n",
    "\n",
    "r1 = pd.Series(mod.labels_).value_counts()\n",
    "r2 = pd.DataFrame(mod.cluster_centers_)\n",
    "r = pd.concat([r2, r1], axis = 1)\n",
    "r.columns = list(d.columns) + [u'类别数目']\n",
    "print(r)\n",
    "#给每一条数据标注上被分为哪一类\n",
    "r = pd.concat([d, pd.Series(mod.labels_, index = d.index)], axis = 1)\n",
    "r.columns = list(d.columns) + [u'聚类类别']\n",
    "print(r)\n",
    "\n",
    "#可以看出，聚类类别为标签2的为贫困群体，\n",
    "#单次消费金额低，消费次数高（在食堂次数多），而且花费却不高\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
